#include<iostream>
#include<vector>
#include<queue>
using namespace std;
#include"priority_queue.h"
class Solution {
public:
    int findKthLargest(vector<int>& nums, int k) {
        abc::priority_queue<int, vector<int>, greater<int>> ret;
        for (int i = 0; i < nums.size(); i++)
        {
            if (i < k)
            {
                ret.push(nums[i]);
                continue;
            }
            if (nums[i] > ret.top())
            {
                ret.pop();
                ret.push(nums[i]);
            }
        }
        return ret.top();
    }
};
int main()
{
   
    vector<int> num = { 1,1,1,4,5,6,7,8 };
    Solution a;
    cout<<a.findKthLargest(num,4);
	return 0;
}